<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%-- 修改代码(1) --%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="http://shiro.apache.org/tags" prefix="shiro" %>

<c:set var="ctxPath" value="${pageContext.request.contextPath}"/>

<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>在线酒店管理系统</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <meta name="apple-mobile-web-app-status-bar-style" content="black"> 
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="format-detection" content="telephone=no">
  <!-- 修改代码(2) -->
  <link rel="stylesheet" href="${ctxPath}/static/layui/css/layui.css?t=1554901098009"  media="all">

<style>
#primaryWin{
	width:100%;
	height:100%;
}
</style>

<script>
//[添加代码(3)]
function gotoPage( url ){
	var obj = document.getElementById('primaryWin');
	obj.src = '${ctxPath}'+ url;
}
</script>

</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
  <div class="layui-header">
    <div class="layui-logo">在线酒店管理系统</div>
    <!-- 头部区域（可配合layui已有的水平导航） -->
    <ul class="layui-nav layui-layout-left">
      <li class="layui-nav-item"><a href="">控制台</a></li>
      <li class="layui-nav-item"><a href="">商品管理</a></li>
      <li class="layui-nav-item"><a href="">用户</a></li>
      <li class="layui-nav-item">
        <a href="javascript:;">其它系统</a>
        <dl class="layui-nav-child">
          <dd><a href="">邮件管理</a></dd>
          <dd><a href="">消息管理</a></dd>
          <dd><a href="">授权管理</a></dd>
        </dl>
      </li>
    </ul>
    
    <ul class="layui-nav layui-layout-right">
      <li class="layui-nav-item">
        <a href="javascript:;">
          <!-- 添加代码(4) -->
          <img src="${ctxPath}/static/images/1.jpg"
			class="layui-nav-img">
		   <!-- 添加代码(5) -->
           ${user.nickName}[${user.roleName}]
        </a>
        <dl class="layui-nav-child">
          <dd><a href="">基本资料</a></dd>
          <dd><a href="">安全设置</a></dd>
        </dl>
      </li>
      <li class="layui-nav-item"><a href="${ctxPath}/Common/logout">退出登录</a></li>
    </ul>
  </div>
  
  <div class="layui-side layui-bg-black">
    <div class="layui-side-scroll">
      <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
      <ul class="layui-nav layui-nav-tree"  lay-filter="test">
	  	<!-- 左侧菜单栏区域{START} -->
	  	<c:if test="${user.account=='admin'}">
	  	   <c:forEach items="${sysMap}" var="entry">
	  			<c:if test="${entry.value.isAdmin=='1'}">
			        <li class="layui-nav-item">
			          <a class="" href="javascript:;">${entry.value.menuName}</a>
			          <dl class="layui-nav-child">      
			            <c:forEach items="${entry.value.subMenus}" var="subMenu">
			            <c:if test="${subMenu.visible=='1'}">
			            <dd>
							<a href="#" onclick="gotoPage('${subMenu.mapping}');">
								${ subMenu.menuName }
							</a>
			            </dd>
			            </c:if>
						</c:forEach>
			          </dl>
			        </li>
		        </c:if>
	        
            </c:forEach>
        </c:if>
        
        <!-- {B}普通用户的菜单 [先显示通用菜单不走菜单表] -->
        <c:if test="${user.account!='admin'}">
        	<c:forEach items="${genMap}" var="entry">
        		 <li class="layui-nav-item">
		          <a class="" href="javascript:;">${entry.value.menuName}</a>
		          <dl class="layui-nav-child">      
		            <c:forEach items="${entry.value.subMenus}" var="subMenu">
		            <c:if test="${subMenu.visible=='1'}">
		            <dd>
						<a href="#" onclick="gotoPage('${subMenu.mapping}');">
							${ subMenu.menuName }
						</a>
		            </dd>
		            </c:if>
					</c:forEach>
		          </dl>
		        </li>
        	</c:forEach>
        	
        	<c:forEach items="${sysMap}" var="entry">
        	
        		<c:if test="${entry.value.isAdmin!='1'}">
        			<shiro:hasPermission name="${entry.value.permission}">
	        	 	<li class="layui-nav-item">
			          <a class="" href="javascript:;">${entry.value.menuName}</a>
			          <dl class="layui-nav-child">      
			            <c:forEach items="${entry.value.subMenus}" var="subMenu">
			            <c:if test="${subMenu.visible=='1'}">
			            <dd>
							<a href="#" onclick="gotoPage('${subMenu.mapping}');">
								${ subMenu.menuName }
							</a>
			            </dd>
			            </c:if>
						</c:forEach>
			          </dl>
			        </li>
			        </shiro:hasPermission>
		        </c:if>
		        
        	</c:forEach>
        </c:if>
        
        
        
        
        

        <!-- 左侧菜单栏区域{END} -->

      </ul>
    </div>
  </div>
  
  <div class="layui-body">
    <!-- 内容主体区域 -->
		<iframe id="primaryWin" scrolling="no" 
			frameborder="0"
			src="${ctxPath}/Common/welcome" ></iframe>
	<!-- 内容主体区域 -->
  </div>
  
  <div class="layui-footer">
    <!-- {Note} 底部固定区域 -->
    ALECTER.COM --- 艾力特信息技术有限公司
  </div>
</div>
	<!-- {PS}修改代码(7) -->
	<script src="${ctxPath}/static/layui/layui.js?t=1554901098009" charset="utf-8">
	</script>
	
<script>
//JavaScript代码区域
layui.use('element', function(){
  var element = layui.element;
  
});
</script>
<script>
var _hmt = _hmt || [];
(function() {
	var hm = document.createElement("script");
	hm.src = "https://hm.baidu.com/hm.js?d214947968792b839fd669a4decaaffc";
	var s = document.getElementsByTagName("script")[0]; 
	s.parentNode.insertBefore(hm, s);
})();
</script>
</body>
</html>
